package com.team.book.common.constant;

import org.springframework.http.HttpStatus;

/**
 * @author iw
 * @create 2017-05-08 15:08
 **/
public enum ResponseStatus {
    OK(HttpStatus.OK.value(),"操作成功"),
    BAD_REQUEST(HttpStatus.BAD_REQUEST.value(),"操作失败"),
    NOT_FOUND(HttpStatus.NOT_FOUND.value(),"没有找到"),
    NOT_BORROW(HttpStatus.BAD_REQUEST.value(),"不可借阅，已在借出"),
    NOT_RETURN_BOOK(HttpStatus.BAD_REQUEST.value(),"不可还书，没有借出"),
    USER_EXIST(HttpStatus.BAD_REQUEST.value(),"用户名已存在"),
    NOT_AUTH(HttpStatus.BAD_REQUEST.value(),"没有操作权限"),
    NOT_SELECT(HttpStatus.BAD_REQUEST.value(),"缺少查询参数");
    private int code;
    private String message;

    ResponseStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
